package com.party.core.model.photo;

/**
 * @Description: 操作枚举
 * @Author: yangshoukun
 * @Date: 2018/6/6 14:53
 */
public enum  OperateEnum {

    OPERATE_MOVE_TAG(1, "移动分类"),
    OPERATE_UPLOAD_IMG(2, "上传照片");

    private Integer code;
    // 操作
    private String  operate;

    OperateEnum(Integer code, String operate) {
        this.code = code;
        this.operate = operate;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getOperate() {
        return operate;
    }

    public void setOperate(String operate) {
        this.operate = operate;
    }

    public static OperateEnum getByOperate(String operate) {
        OperateEnum[] values = OperateEnum.values();
        for (OperateEnum value : values) {
            if (value.getOperate().equals(operate)) {
                return value;
            }
        }
        return null;
    }

    public static OperateEnum getByCode(Integer code) {
        OperateEnum[] values = OperateEnum.values();
        for (OperateEnum value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
